export function mergeArrays(arr1, arr2) {
  const merged = {}
  // 遍历第一个数组
  arr1.forEach(item => {
    const key = item.id
    if (!merged[key]) {
      merged[key] = { ...item }
    } else {
      merged[key] = { ...merged[key], ...item }
    }
  })
  // 遍历第二个数组
  arr2.forEach(item => {
    const key = item.id
    if (!merged[key]) {
      merged[key] = { ...item }
    } else {
      merged[key] = { ...merged[key], ...item }
    }
  })
  return Object.values(merged)
}
